export const scoket = window.io();
const onQueue = [];
scoket.on("chat message", (res) => {
    onQueue.forEach((on) => {
        if (on.role === res.role && (on.path === res.path || on.path === "*")) {
            on.cb({ path: on.role, role: on.path, value: res.value });
        }
    });
});
export const on = {
    p1(path, cb) {
        onQueue.push({ role: "p1", path, cb });
    },
    p2(path, cb) {
        onQueue.push({ role: "p2", path, cb });
    },
};
